#include <iostream>
#include "CIniFile.h"
using namespace std;

int main()
{
    CString str;
    CStringArray node_arr;
    CStringArray key_arr;
    KeyVal kv;
    KeyVal::iterator it;
    CIniFile myfile(".\\test.ini");
    myfile.SetValue( "node", "key", "val" );
    myfile.SetValue( "node", "key1", "val1" );
    myfile.SetValue( "node", "key2", "val2" );
    myfile.SetValue( "node1", "key", "val" );
    myfile.SetValue( "node1", "key1", "val1" );
    myfile.SetValue( "node1", "key5", "val5" );
   
    myfile.GetNodes( node_arr );
    for( int i=0;i<node_arr.GetSize();i++)
    {
      cout<<node_arr[i].GetBuffer()<<endl;
      kv.clear();
      myfile.GetKeys(node_arr[i],kv);
      for( it=kv.begin();it!=kv.end();it++)
      {
          cout<<it->first<<"="<<it->second<<endl;
      }
    }
    myfile.DelKey( "node1", "key" );
    myfile.DelNode( "node1" );
    myfile.DelAllNodes();
}